<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich">
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>单据审批</title>
        <script type="text/javascript">
            function showProj() {
                window.open("./pubinfo/projList.jsf", "项目列表", "height=1024,width=800,toolbar=no,menubar=no,scrollbars=no");
            }
            function updateProjSelect(code, name) {
                document.getElementById('tp:projCode').value = code;
                document.getElementById('tp:projName').value = name;
            }

            function showDept() {
                window.open("./pubinfo/departmentList.jsf", "部门列表", "height=1024,width=800,toolbar=no,menubar=no,scrollbars=no");
            }
            function updateDept(code, name) {
                document.getElementById('tp:deptcode').value = code;
                document.getElementById('tp:deptname').value = name;
            }
        </script>
    </h:head>
    <h:body>
        <h:form id="tp">
            <rich:panel header="审批单据" styleClass="content-hight">

                <h:panelGroup id="tableGroup">
                    <rich:dataScroller for="tableEdit" execute="@this" render="tableGroup"/>
                    <div style="width:750px;overflow: auto;">
                        <rich:dataTable id="tableEdit"
                                        value="#{contractCheckBean.model}" var="incontract"
                                        rowClasses="list-row-odd,list-row-even"
                                        headerClass="table-header"
                                        rows="6"
                                        style="width:1200px;margin-bottom:5px;"
                                        noDataLabel="无数据">
                            
                            <rich:column sortBy="#{incontract.number}">
                                <h:commandLink action="#{contractCheckBean.checkinfo}" >
                                    <h:outputText value="审批"    rendered="#{incontract.flowMark eq '1'}" />
                                    <h:outputText value="审批已完成"  rendered="#{incontract.flowMark eq '4'}" />
                                </h:commandLink>
                            </rich:column>

                            <rich:column sortBy="#{incontract.number}">
                                <f:facet name="header">编号</f:facet>
                                #{incontract.number}
                            </rich:column>

                            <rich:column sortBy="#{incontract.cname}">
                                <f:facet name="header">名称</f:facet>
                                <h:outputText value="#{incontract.cname}">
                                </h:outputText>
                            </rich:column>
                            <rich:column sortBy="#{incontract.contractTypeName}">
                                <f:facet name="header">合同类别</f:facet>
                                <h:outputText value="#{incontract.contractTypeName}">
                                </h:outputText>
                            </rich:column>
                            <rich:column sortBy="#{incontract.address}">
                                <f:facet name="header">地点</f:facet>
                                <h:outputText value="#{incontract.address}">
                                </h:outputText>
                            </rich:column>
                            <rich:column sortBy="#{incontract.orderdate}">
                                <f:facet name="header">签订日期</f:facet>
                                <h:outputText value="#{incontract.orderdate}">
                                    <f:convertDateTime dateStyle="medium"/>
                                </h:outputText>
                            </rich:column>
                            <rich:column sortBy="#{incontract.start}">
                                <f:facet name="header">开始日期</f:facet>
                                <h:outputText value="#{incontract.start}">
                                    <f:convertDateTime dateStyle="medium"/>
                                </h:outputText>
                            </rich:column>
                            <rich:column sortBy="#{incontract.deadline}">
                                <f:facet name="header">截止日期</f:facet>
                                <h:outputText value="#{incontract.deadline}">
                                    <f:convertDateTime dateStyle="medium"/>
                                </h:outputText>
                            </rich:column>
                            <rich:column sortBy="#{incontract.warranty}">
                                <f:facet name="header">质保日期</f:facet>
                                <h:outputText value="#{incontract.warranty}">
                                    <f:convertDateTime dateStyle="medium"/>
                                </h:outputText>
                            </rich:column>
                            <rich:column sortBy="#{incontract.nameA}">
                                <f:facet name="header">甲方</f:facet>
                                <h:outputText value="#{incontract.nameA}"/>
                            </rich:column>
                            <rich:column sortBy="#{incontract.nameAstand}">
                                <f:facet name="header">甲方法人</f:facet>
                                <h:outputText value="#{incontract.nameAstand}"/>
                            </rich:column>
                            <rich:column sortBy="#{incontract.partner.name}">
                                <f:facet name="header">乙方</f:facet>
                                <h:outputText value="#{incontract.partner.name}"/>
                            </rich:column>
                            <rich:column sortBy="#{incontract.partner.legalPerson}">
                                <f:facet name="header">乙方法人</f:facet>
                                <h:outputText value="#{incontract.partner.legalPerson}"/>
                            </rich:column>
                            <rich:column sortBy="#{incontract.target}">
                                <f:facet name="header">标的</f:facet>
                                <h:outputText value="#{incontract.target}"/>
                            </rich:column>
                            <rich:column sortBy="#{incontract.quality_margin}">
                                <f:facet name="header">质保金</f:facet>
                                <h:outputText value="#{incontract.quality_margin}"/>
                            </rich:column>
                            <rich:column sortBy="#{incontract.penalty}">
                                <f:facet name="header">违约金</f:facet>
                                <h:outputText value="#{incontract.penalty}"/>
                            </rich:column>
                            <rich:column sortBy="#{incontract.other}">
                                <f:facet name="header">其他</f:facet>
                                <h:outputText value="#{incontract.other}"/>
                            </rich:column>
                            <f:facet name="footer"></f:facet>
                        </rich:dataTable>

                        <rich:jQuery selector="#tableEdit tr:odd" query="addClass('odd-row')" />
                        <rich:jQuery selector="#tableEdit tr:even" query="addClass('even-row')" />
                        <rich:jQuery selector="#tableEdit tr"
                                     query="mouseover(function(){jQuery(this).addClass('active-row')})"/>
                        <rich:jQuery selector="#tableEdit tr"
                                     query="mouseout(function(){jQuery(this).removeClass('active-row')})"/>
                    </div>
                </h:panelGroup>
            </rich:panel>
        </h:form>
    </h:body>
</ui:composition>
